package com.rz.paas.baselib.netRequest.request.okhttp

import android.content.Context
import com.rz.paas.baselib.netRequest.request.IHttpRequest
import com.rz.paas.baselib.netRequest.response.JsonCallback

class OkHttpRequest() : IHttpRequest {


    override fun <T> post(
        context: Context?,
        params: Map<String, Any?>?,
        url: String?,
        cache: Boolean,
        callback: JsonCallback<T>
    ) {
        var post = ApiService.post<T>(url) /*as PostRequest<T>*/
        var iterator = params!!.iterator()
        while (iterator.hasNext()) {
            var next = iterator.next()
            post.addParam(next.key, next.value!!)
        }
        post.execute(callback)
    }


    override fun <T>  get(
        context: Context?,
        params: Map<String, Any?>?,
        url: String?,
        cache: Boolean,
        callback: JsonCallback<T>
    ) {

    }


}